package com.dys.testwrap;

/**
 * @className: com.dys.testwrap.StudentTest
 * @description: com.dys.testwrap
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/07/17 下午10:19
 */
public class StudentTest {
    /**
     * 这是一个main()方法,是应用程序的入口
     *
     * @param args 方法的形参列表,是一个字符串数组,包含了从命令行传递给程序的参数
     */
    public static void main(String[] args) {
        Student student = new Student();
        // 设置属性
        // student.setGender('s');
        // 读取属性
        // System.out.println(student.getGender());

        student.setSex("ioejwiofjoewjwioejwo");
        System.out.println(student.getSex());
        student.setAge(90);
        System.out.println(student.getAge());

        // 构造器控制性别
        Student student1 = new Student("张淑娜", 25, "乱七八糟");
        System.out.println(student1.getSex());
        // 抛出年龄不合法的异常
        Student student2 = new Student("张淑娜", 250, "乱七八糟");
        System.out.println(student2.getAge());
    }
}
